﻿USE [statistics]

GO
/****** Objekt:  ForeignKey [FK_LogFiles_Sites]    Skriptdatum: 04/10/2010 17:04:04 ******/
ALTER TABLE [LogFiles] DROP CONSTRAINT [FK_LogFiles_Sites]
GO
/****** Objekt:  Table [dbo].[LogFiles]    Skriptdatum: 04/10/2010 17:04:03 ******/
DROP TABLE [LogFiles]
GO
/****** Objekt:  Table [dbo].[Visits]    Skriptdatum: 04/10/2010 17:04:31 ******/
DROP TABLE [Visits]
GO
/****** Objekt:  Table [dbo].[Pages]    Skriptdatum: 04/10/2010 17:04:07 ******/
DROP TABLE [Pages]
GO
/****** Objekt:  Table [dbo].[Sites]    Skriptdatum: 04/10/2010 17:04:12 ******/
DROP TABLE [Sites]
GO

/****** Objekt:  Table [dbo].[Sites]    Skriptdatum: 04/10/2010 17:04:12 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [Sites](
	[SiteId] [int] IDENTITY(1,1) NOT NULL,
	[Name] [text] NOT NULL,
	[SiteName] [text] NOT NULL,
	[LogPath] [text] NOT NULL,
 CONSTRAINT [PK_Sites] PRIMARY KEY CLUSTERED 
(
	[SiteId] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

/****** Objekt:  Table [dbo].[Visits]    Skriptdatum: 04/10/2010 17:04:31 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [Visits](
	[Id] [bigint] IDENTITY(1,1) NOT NULL,
	[SiteId] [int] NULL,
	[VisitorIp] [ntext] NULL,
	[VisitorFirstTime] [datetime] NULL,
	[VisitorLastTime] [datetime] NULL,
	[EntrySiteId] [bigint] NULL,
	[VisitorTotalActions] [int] NULL,
	[Referer] [ntext] NULL,
	[OS] [ntext] NULL,
	[WebBrowser] [ntext] NULL,
	[WebBrowserVersion] [ntext] NULL,
	[Resolution] [ntext] NULL,
	[TrafficSent] [bigint] NULL,
	[TrafficGet] [bigint] NULL,
	[Visits] [int] NULL,
	[VisitorType] [int] NULL,
 CONSTRAINT [PK_Visits] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

/****** Objekt:  Table [dbo].[Pages]    Skriptdatum: 04/10/2010 17:04:07 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [Pages](
	[Id] [bigint] IDENTITY(1,1) NOT NULL,
	[SiteId] [bigint] NULL,
	[Url] [varchar](max) NULL,
 CONSTRAINT [PK_WebSites] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO

/****** Objekt:  Table [dbo].[LogFiles]    Skriptdatum: 04/10/2010 17:04:03 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [LogFiles](
	[Id] [int] IDENTITY(1,1) NOT NULL,
	[SiteId] [int] NOT NULL,
	[LogFile] [text] NULL,
	[CurrentLine] [bigint] NULL,
	[Processed] [int] NULL,
 CONSTRAINT [PK_LogFiles] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

/****** Objekt:  ForeignKey [FK_LogFiles_Sites]    Skriptdatum: 04/10/2010 17:04:04 ******/
ALTER TABLE [LogFiles]  WITH CHECK ADD  CONSTRAINT [FK_LogFiles_Sites] FOREIGN KEY([SiteId])
REFERENCES [Sites] ([SiteId])
GO
ALTER TABLE [LogFiles] CHECK CONSTRAINT [FK_LogFiles_Sites]
GO
